﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using YKhoa_Lib.DAL;

namespace YKhoa_Lib.BLL
{
    public class NhomDichVu
    {
        private int _id;
        public int ID
        {
            get { return _id; }
        }
        private string _maNhom;
        public string MaNhom
        {
            get { return _maNhom; }
        }
        private string _tenNhom;
        public string TenNhom
        {
            get { return _tenNhom; }
        }
        private string _diaDiemNhom;
        public string DiaDiemNhom
        {
            get { return _diaDiemNhom; }
        }
        private List<DichVu> _dichVus;
        public List<DichVu> DichVus
        {
            get { return _dichVus; }
        }

        private DAL_DichVu dal_DichVu;
        public NhomDichVu()
        {
            dal_DichVu = new DAL_DichVu();
            _dichVus = new List<DichVu>();
        }

        public List<NhomDichVu> LoadChiTietNhomDichVu(string _maKhoa)
        {
            DataTable dt = dal_DichVu.LoadNhomDichVu(_maKhoa);
            List<NhomDichVu> listNhom = new List<NhomDichVu>();
            NhomDichVu nhom = null;
            foreach(DataRow row in dt.Rows)
            {
                nhom = new NhomDichVu();
                //nhom._id = Factory.emptyNull(row["ID"]) != "" ? int.Parse(row["ID"].ToString()) : 0;
                nhom._maNhom = Factory.emptyNull(row["Nhom"]);
                nhom._tenNhom = Factory.emptyNull(row["TenNhom"]);
                //nhom._diaDiemNhom = Factory.emptyNull(row["DiaDiemNhom"]);               
                listNhom.Add(nhom);
            }
            return listNhom;
        }        
    }
}